import axios from "axios";
let baseURL = "";

export default {
  async load(names) {
    let urlPrefix = baseURL + "/tms/enum/";
    let promiseList = names.map((name) => {
      return axios.get(urlPrefix + name);
    });

    let valueMap = {};
    let valueList = await Promise.all(promiseList);
    for (let [index, name] of names.entries()) {
      valueMap[name] = valueList[index].data;
    }
    return valueMap;
  }
};
